﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Lawn.NetMessage.Extensions
{
    public class Invoker
    {

        public static void SetText<T>(T ct, string val) where T:Control
        {
             

            if (ct.InvokeRequired)
            {
                ct.BeginInvoke(new Action<Control, string>(SetText), new object[] { ct, val });
            }
            else
            {
                ct.Text = val;
            }

        }
    }
}
